import Vue from 'vue'
import App from './App'

// vuex
import store from './store'

// 引入全局uView
import uView from '@/uni_modules/uview-ui'

import mixin from '@/mixins/index'
import comm from '@/common/common'

Vue.prototype.$store = store
Vue.prototype.$c = comm;
uni.$c = comm;
Vue.prototype.$configResolve = new Promise(resolve => {
	Vue.prototype.$isResolve = resolve;
})

Vue.config.productionTip = false

App.mpType = 'app'
Vue.use(uView)

//修改uview默认主题色
uni.$u.config.color.primary = store.state.$style.primary

// // #ifdef MP
// // 引入uView对小程序分享的mixin封装
// const mpShare = require('@/uni_modules/uview-ui/libs/mixin/mpShare.js')
// Vue.mixin(mpShare)
// // #endif

Vue.mixin(mixin)

const app = new Vue({
    store,
    ...App
})

// http接口API抽离，免于写url或者一些固定的参数
import httpApi from '@/config/api.js'
Vue.use(httpApi, app)

// 引入请求封装
require('./util/request/index')(app)

app.$mount()
